home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / asm32.zip / E32.ZIP / SH_RL.ASM < prev    next >
Assembly Source File  |  1994-01-18  |  923b  |  44 lines

  1. ; SH_RL.ASM for E32 - Copyright (C) 1994 Douglas Herr
  2. ;  all rights reserved
  3.  
  4. ; These two routines shift the display right or left to allow
  5. ; editing files which contain lines longer than 80 columns
  6. ;
  7.  
  8. include    model.inc
  9.  
  10. public    sh_right, sh_left
  11. extrn    cursor_col:near
  12.  
  13. include    dataseg.inc
  14. extrn    left_margin:word
  15. extrn    cur_posn:word
  16. extrn    save_column:byte
  17. extrn    dirty_bits:byte
  18. @curseg    ends
  19.  
  20. include    codeseg.inc
  21. sh_right    proc    near
  22.     cmp    left_margin,65535-8
  23.     cmc
  24.     jc    short no_shift
  25.     add    left_margin,8    ; this moves the margin over
  26. sh_return:
  27.     call    cursor_col    ; compute column for cursor
  28.     mov    dx,cur_posn
  29.     mov    save_column,dl    ; save the current column
  30.     or    dirty_bits,1    ; redraw the screen
  31. no_shift:
  32.     ret
  33. sh_right    endp
  34.  
  35. sh_left    proc    near
  36.     cmp    left_margin,0    ; already at start of line?
  37.     je    no_shift
  38.     sub    left_margin,8    ; move the window over
  39.     jmp    sh_return
  40. sh_left    endp
  41.  
  42. @curseg    ends
  43.     end
  44.